﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MealBooking.Core.Models.Meals;
using Microsoft.Practices.ServiceLocation;
using MealBooking.Core.Services.Interface.OrderService;
using MealBooking.Core.Models.Accounts;
using MealBooking.Core.Models.Orders;

namespace MealBooking.Core
{
    public static partial class CoreService
    {
        public static class OrderService
        {
            #region private
            private static IOrderService GetInstance()
            {
                return ServiceLocator.Current.GetInstance<IOrderService>();
            }
            #endregion

            #region Order
            public static List<Order> TodayOrders()
            {
                return GetInstance().TodayOrders();
            }
            public static Order OrderDetail(string orderId)
            {
                return GetInstance().OrderDetail(orderId);
            }
            #endregion

            #region User's Order
            public static List<Order> Orders(string accountId)
            {
                return GetInstance().Orders(accountId);
            }
            public static Order UserTodayOrder(string accountId)
            {
                return GetInstance().UserTodayOrder(accountId);
            }
            public static Order AddMealToOrder(string customerId, MealWithSum newMeal)
            {
                return GetInstance().AddMealToOrder(customerId, newMeal);
            }
            public static Order UpdateUserTodayOrder(Order newOrder)
            {
                return GetInstance().UpdateUserTodayOrder(newOrder);
            }
            public static Order OrderUserTodayOrder(string accountId)
            {
                return GetInstance().OrderUserTodayOrder(accountId);
            }
            public static void DeleteUserTodayOrder(string accountId)
            {
                GetInstance().DeleteUserTodayOrder(accountId);
            }
            #endregion

            #region Manager's Order
            public static ManagerOrder ManagerTodayOrder(string managerId)
            {
                return GetInstance().ManagerTodayOrder(managerId);
            }
            public static List<Order> TodayOrdersInManagerOrder(string managerId)
            {
                return GetInstance().TodayOrdersInManagerOrder(managerId);
            }
            public static ManagerOrder BookManagerOrder(string managerId)
            {
                return GetInstance().BookManagerOrder(managerId);
            }
            public static ManagerOrder AddOrderToManagerOrder(Order newOrder)
            {
                return GetInstance().AddOrderToManagerOrder(newOrder);
            }
            #endregion
        }
    }
}
